package com.yu8home.opcua.test;

import com.yu8home.opcua.OpcUAUtil;
import org.eclipse.milo.opcua.stack.core.AttributeId;
import org.eclipse.milo.opcua.stack.core.Identifiers;
import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
import org.eclipse.milo.opcua.stack.core.types.structured.ContentFilter;
import org.eclipse.milo.opcua.stack.core.types.structured.EventFilter;
import org.eclipse.milo.opcua.stack.core.types.structured.SimpleAttributeOperand;

import java.util.ArrayList;
import java.util.List;

public class Const {
    // public static String singleIdentifier = "Simulation Examples.Functions.k";
    // public static String singleIdentifier = "JF.PLC.SY1";
    // public static String singleIdentifier = "DDM3_65.DDM3.DM3_FHM1_CLOSE";
    //  public static String singleIdentifier = "Air.Collector.温度补偿值";// Word
    // public static String singleIdentifier = "Simulation Examples.Functions.User3";
    public static String singleIdentifier = "Air.Collector.26预留";// Long
    // public static String singleIdentifier = "Air.Collector.氡气长期值";// Short
    // public static String singleIdentifier = "Air.Collector.29预留";// Float
    // public static String singleIdentifier = "Group_DZ.FDJ2.FDGLTJ2";// Boolean


    public static List<String> subscribes = new ArrayList<>() {{
        add("IO_04_27.sfp13.SFP13");
    }};


    public static EventFilter eventFilter = new EventFilter(
            new SimpleAttributeOperand[]{
                    new SimpleAttributeOperand(
                            Identifiers.BaseEventType,
                            new QualifiedName[]{new QualifiedName(OpcUAUtil.namespaceIndex, "EventId")},// 0
                            AttributeId.Value.uid(),
                            null),
                    new SimpleAttributeOperand(
                            Identifiers.BaseEventType,
                            new QualifiedName[]{new QualifiedName(OpcUAUtil.namespaceIndex, "EventType")},// 1
                            AttributeId.Value.uid(),
                            null),
                    new SimpleAttributeOperand(
                            Identifiers.BaseEventType,
                            new QualifiedName[]{new QualifiedName(OpcUAUtil.namespaceIndex, "SourceNode")},// 2
                            AttributeId.Value.uid(),
                            null),
                    new SimpleAttributeOperand(
                            Identifiers.BaseEventType,
                            new QualifiedName[]{new QualifiedName(OpcUAUtil.namespaceIndex, "SourceName")},// 3
                            AttributeId.Value.uid(),
                            null),
                    new SimpleAttributeOperand(
                            Identifiers.BaseEventType,
                            new QualifiedName[]{new QualifiedName(OpcUAUtil.namespaceIndex, "Severity")},// 4
                            AttributeId.Value.uid(),
                            null),
                    new SimpleAttributeOperand(
                            Identifiers.BaseEventType,
                            new QualifiedName[]{new QualifiedName(OpcUAUtil.namespaceIndex, "Time")},// 5
                            AttributeId.Value.uid(),
                            null),
                    new SimpleAttributeOperand(
                            Identifiers.BaseEventType,
                            new QualifiedName[]{new QualifiedName(OpcUAUtil.namespaceIndex, "Message")},// 6
                            AttributeId.Value.uid(),
                            null)
            },
            new ContentFilter(null)
    );

}
